********************************************************************************
* Replication Data for                                                         *
*                                                                              *
*                Discrimination, narratives and family history:                *
*         An experiment with Jordanian host and Syrian refugee children        *
*                                                                              *
*                                                                              *
*      Kai Barron, Heike Harmgart, Steffen Huck, Sebastian O. Schneider,       * 
*                              and Matthias Sutter                             *
*                                                                              *
*                                   May 2021                                   *
********************************************************************************

*****************************
** to run stata in batch mode using the command line (much faster) use:
** stata -b do runBuild.do
*****************************
* Set necessary paths, e.g.:
global path "C:\Users\schneider\Documents\Research\Projects\DiscriminationJordan"

* Change to given directory
cd "$path"

****************************************************
set graphics on  
set more off
set scheme s1mono
version 14.2

****************************************************
* Clean and prepare Data for Analyses
****************************************************
do code/prepareAndCleanData

********************************************************************************
************** Experimental Data and Questionnaires - Main Results *************
********************************************************************************

* Read in Experimental Data and Questionnaires
use "1_input\Jordan_Dataset_Clean.dta", replace
	
* Generate Tables - Experimental Data
do code/Table1
do code/Table2
do code/Tables3andA4
do code/TableA3

* Generate Figures - Experimental Data
do code/FiguresA1toA3

* Replicate all other results stated in the paper
do code/furtherResults.do
do code/furtherResultsRobustness.do

********************************************************************************
****** Data on Sample Selection: Demographics and Teacher's Questionnaire ******
********************************************************************************

** Demographics Children
use "1_input\Jordan_UNICEF_Sample_Demographics_Clean.dta", replace
	
do code/TablesA1andA2

** Teachers Questionnaire - Evaluation MEMTA
use "1_input\Jordan_TeachersQuestionnaire_Clean.dta", replace
	
do code/TablesA1andA2

* Have a nice day!